from toee import *
from utilities import *

def san_dialog( attachee, triggerer ):
	attachee.turn_towards(triggerer)
	if (game.quests[74].state == qs_completed and game.quests[78].state == qs_unknown):
		triggerer.begin_dialog( attachee, 450 )
	elif (game.global_vars[996] == 6):
		triggerer.begin_dialog( attachee, 630 )
	else:
		triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def san_dying( attachee, triggerer ):
	game.global_flags[992] = 1
	return RUN_DEFAULT

def distribute_verbobonc_uniform(npc,pc):
	for obj in pc.group_list():
		create_item_in_inventory( 6498, obj )
		create_item_in_inventory( 6269, obj )
	return RUN_DEFAULT

def san_will_kos( attachee, triggerer ):
	if (game.global_flags[992] == 0):
		return SKIP_DEFAULT
	return RUN_DEFAULT

def san_first_heartbeat( attachee, triggerer ):
	if (game.global_flags[992] == 1):
		attachee.object_flag_set(OF_OFF)
		return RUN_DEFAULT
	if (game.global_flags[981] == 1):
		attachee.object_flag_unset(OF_OFF)
	else:
		attachee.object_flag_set(OF_OFF)
		return RUN_DEFAULT
	return RUN_DEFAULT